package com.onluy.frameworkcloud.data.bean;


import java.io.Serializable;
import java.util.List;

public class PageData<E> implements Serializable {

    private boolean  success =	false ;

    private static final long serialVersionUID = 1;
    private long total;
    private int currPage = 1;
    private int pageSize = 10;
    private List<E> rows;

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }
    public List<E> getRows() {
        return this.rows;
    }

    public void setRows(List<E> rows) {
        this.rows = rows;
    }

    public long getTotal() {
        return this.total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public int getCurrPage() {
        return this.currPage;
    }

    public void setCurrPage(int currPage) {
        this.currPage = currPage;
    }

    public int getPageSize() {
        return this.pageSize<=0?10:this.pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public long getTotalPages() {
        return this.getTotal() % (long) this.getPageSize() == 0L
                ? this.getTotal() / (long) this.getPageSize()
                : this.getTotal() / (long) this.getPageSize() + 1L;
    }
}